import request from '@/utils/request'

// /vm-service/node/nodeCollect
export const getnodeCollect = () => {
  return request.get('/vm-service/node/nodeCollect')
}

// /vm-service/node/count

export const getNodeCount = () => {
  return request.get('/vm-service/node/count')
}

// /vm-service/channel/channelList/
export const getChannelList = (id) => {
  return request.get(`/vm-service/channel/channelList/${id}`)
}

// /vm-service/policy/search
export const getPolicySearch = (data) => {
  return request.get('/vm-service/policy/search', {
    params: data
  })
}

// /vm-service/policy
export const postPolicy = (params) => {
  return request.post('/vm-service/policy', {
    params
  })
}

export const editPolicy = (params) => {
  return request.post(`/vm-service/policy/${params.policyId}`, {
    params
  })
}

// /vm-service/policy/:policyId
export const deletePolicy = (policyId) => {
  return request.delete(`/vm-service/policy/${policyId}`)
}

// /vm-service/policy/vmList/:policyId
export const getVmList = (policyId, params) => {
  return request.get(`/vm-service/policy/vmList/${policyId}`, {
    params
  })
}
